package com.wd.demo1.i18;

import com.intellij.AbstractBundle;
import java.text.MessageFormat;
import java.util.Locale;
import java.util.ResourceBundle;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;

/**
 * @author Administrator
 * @date 2025-11-12 0:42
 */
public class DemoBundle extends AbstractBundle {

	private static final String BUNDLE_PATH = "messages.DemoBundle";
	private static final ResourceBundle bundle = ResourceBundle.getBundle(BUNDLE_PATH, getLocale());

	public static String message(@NotNull String key, Object... params) {
		return MessageFormat.format(bundle.getString(key), params);
	}

	public DemoBundle(@NonNls @NotNull String pathToBundle) {
		super(pathToBundle);
	}

	private static Locale getLocale() {
		return Locale.CHINESE;
	}
}
